<%@ include file = "/common/ini.jsp"%>
<%@ include file = "/common/_log4j.jsp"%>
<%@ include file = "/common/_ApplicationContext_init.jsp"%>
<%@ include file = "/js/_js_for_select.jsp"%>
<script>
    delAllOptions(parent.detailForm.homeId);
    delAllOptions(parent.detailForm.areaId);
    delAllOptions(parent.detailForm.parentId);
    parent.detailForm.areaId.disabled = true;
    parent.detailForm.parentId.disabled = true;
    addOption(parent.detailForm.homeId,"null","无");
    addOption(parent.detailForm.areaId,"null","无");
    addOption(parent.detailForm.parentId,"null","无");
<%
    logger.debug("开始查询所有homes");
    HomeManager homeManager = (HomeManager)applicationContext.getBean("homeManager");
    List homes = homeManager.findAllHomes();
    for(int i = 0; i < homes.size(); i ++)
    {
        Home home = (Home)homes.get(i);
        %>addOption(parent.detailForm.homeId,"<%= home.getId()%>","<%= home.getName()%>");<%
    } // for
    if(request.getParameter("homeId")!= null)
    {
        %>parent.detailForm.homeId.value="<%= request.getParameter("homeId")%>";<%
    }
%>
    parent.detailForm.areaId.disabled = false;
    parent.detailForm.parentId.disabled = false;
    
</script> 